package com.fingard.dsp.bank.reqrespobj.virtualaccount;

import com.fingard.dsp.bank.reqrespobj.ReqRespHeader;
import com.fingard.dsp.bank.reqrespobj.RetAtsBase;
import com.fingard.dsp.bank.reqrespobj.virtualaccount.detail.RetAtsOpenAccount;
import com.fingard.xml.XmlTextWriter;

public class RetAts7503BalQry extends RetAtsBase {
    public RetAts7503BalQry(ReqRespHeader p_header) {
        retHeader = p_header;
        retXmlWriter = new XmlTextWriter();//用于输出返回ATS的XML报文
    }

    private int writeRdCount = 0;

    public int getWrittenRdCount() {
        return writeRdCount;
    }

    public void writeRetDetail(RetAtsOpenAccount p_retDetail) throws Exception {
        writeRdCount++;
        if (writeRdCount == 1) {
            if (!hasWrittenRespCode) {
                writeRespCode("0");
            }
            if (!hasWrittenRespInfo) {
                writeRespInfo("");
            }
        }
        retXmlWriter.writeElementString("subAccNo", p_retDetail.subAccNo);
        retXmlWriter.writeElementString("subAccNm", p_retDetail.subAccNm);
        retXmlWriter.writeElementString("hostNo", p_retDetail.hostNo);
        retXmlWriter.writeEndElement();

    }
}
